<header id="page-header"> 
    <h1>Üyeler</h1> 
</header>

<div class="filter">
    <form method="get" action="<?php echo current_url(); ?>">
        <ul>
			<li><?php echo form_dropdown('role_id', $roles, _get('role_id', 'all')); ?></li>
            <li><input type="text" name="needle" value="<?php echo _get('needle'); ?>" /></li>
            <li><input type="submit" value="Ara" /></li>
        </ul>
    </form>
    <br class="clear-both" />
</div>

<div id="content"> 
	<?php echo $this->session->flashdata('status'); ?>
	
    <table class="table-list">
        <thead>
            <tr>
                <th>ID</th>
                <th>E posta</th>
                <th>Seviye</th>
                <th>Kayıt Tarihi</th>
                <th>Son Giriş Tarihi</th>
                <th>İşlemler</th>
            </tr>
        </thead>

        <tbody>

            <?php if ($result['total_rows'] > 0): ?>
                <?php foreach ($result['rows'] as $row): ?>

                    <tr>
                        <td><?php echo $row->id; ?></td>
                        <td><?php echo $row->email; ?></td>
                        <td><?php echo $row->role; ?></td>
                        <td><?php echo format_date($row->date_add); ?></td>
                        <td><?php echo format_date($row->last_login); ?></td>
                        <td>
                            <a href="<?php echo site_url("backend/user/detail/{$row->id}"); ?>" title="Detayları Gör"><img src="assets/backend/icon/luna/zoom.png" alt="" /></a>
                            <a href="<?php echo site_url("backend/user/delete/{$row->id}"); ?>" title="Sil" onclick="return confirm('Silme İşlemini Onaylıyormusunuz?')"><img src="assets/backend/icon/luna/trash.png" alt="" /></a>
                        </td>
                    </tr>

                <?php endforeach; ?>
            <?php else: ?>

                <tr>
                    <td colspan="6"><div class="notification info">Hiçbir kayıt bulunamadı</div></td>
                </tr>

            </tbody>

        <?php endif; ?>
	</table>

	<?php echo $pagination; ?>
</div><!-- // #content -->
